package com.example.demo.api;

import com.example.demo.common.ResponseBack;
import com.example.demo.domain.User;
import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Administrator on 2017/10/26 0026.
 */
@RequestMapping(value = "/user")
@Controller
public class UserController extends BaseController {
    @Autowired
    private UserService userService;

    @RequestMapping(value = "/findById", method = RequestMethod.GET)
    @ResponseBody
    public ResponseBack<User> findById(@RequestParam(value = "id", required = false) Long id) {
        ResponseBack<User> result = userService.findUserById(id);
        return result;
    }
}
